<template>
  <transition name="el-fade-in-linear">
    <router-view />
  </transition>
</template>

<script>
import Cookies from 'js-cookie'
// import { messages } from '@/i18n'
export default {
  watch: {
    '$i18n.locale': 'i18nHandle'
  },
  created () {
    this.i18nHandle(this.$i18n.locale)
  },
  methods: {
    i18nHandle (val, oldVal) {
      Cookies.set('language', val)
      document.querySelector('html').setAttribute('lang', val)
      // document.title = messages[val].brand.lg
      // 非登录页面，切换语言刷新页面
      if (this.$route.name !== 'login' && oldVal) {
        window.location.reload()
      }
    }
  }
}
</script>
<style>
* {
  margin: 0;
  padding: 0;
  scrollbar-color: rgba(0, 90, 255, 0.1) #f7f7f9;
  scrollbar-width: auto
}

.cardBorder {
  border: 1px solid #f0f0f0;
  box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.03);
}
</style>